package modele;

import gui.Ville;

public class Client {

	private double rClient;
	private double thetaClient;
	private int delaiAttente;
	private double rDest;
	private double thetaDest;
	private boolean prisEnCharge;
	private Manager manager;
	
	public Client(Manager manager) {
		rClient = Math.random() * (double)Manager.getCityRadius();
		thetaClient = 2 * Math.PI * Math.random();
		rDest = Math.random() * (double)Manager.getCityRadius();
		thetaDest = 2 * Math.PI * Math.random();
		delaiAttente = (int)(20D * Math.random()) + 1;
		this.manager = manager;
		this.prisEnCharge = false;
	}

	public Client(double rClient, double thetaClient, double rDest, double thetaDest, int delaiAttente, Manager manager) {
		this.rClient = rClient;
		this.thetaClient = thetaClient;
		this.rDest = rDest;
		this.thetaDest = thetaDest;
		this.delaiAttente = delaiAttente;
		this.manager = manager;
		this.prisEnCharge = false;
	}
	
		
	public void reduireDelaiAttente() {
		this.delaiAttente--;
	}

	public double getrClient() {
		return rClient;
	}

	public double getThetaClient() {
		return thetaClient;
	}
	
	public double getrDest() {
		return rDest;
	}

	public double getThetaDest() {
		return thetaDest;
	}

	public int getDelaiAttente() {
		return delaiAttente;
	}
	
	public boolean isPrisEnCharge() {
		return prisEnCharge;
	}
	
	public void setPrisEnCharge(boolean prisEnCharge) {
		this.prisEnCharge = prisEnCharge;
	}
	
	public void estDansTaxi() {
		this.prisEnCharge = true;
		manager.clientDansTaxi(this);
	}
	
	public void estArrive() {
		manager.clientArrive(this);
	}
}